package cn.lcc.utils.commom.pack;

import cn.lcc.utils.commom.annotation.IotField;
import cn.lcc.utils.commom.annotation.IotFieldClass;
import cn.lcc.utils.commom.core.IMessage;

/**
 * 3347 2a 39363230343539343430 2a 30303931 2a 44454d4f
 * 3347 2a 39363230343539343430 2a 30303931 2a 4445 2c
 * 3G *         9620459440      *   0091    *   DE  ,
 *
 * demo,asdasdas
 *
 *
 */
@IotFieldClass(hexValueOptions = "2a")
public class HeadersSchema implements IMessage {

    @IotField(desc = "数据标识符",parseType = "StringSchema",hexStart = 0)
    public String messageMark;

    @IotField(desc = "设备ID",parseType = "StringSchema",hexStart = 1)
    public String deviceId;
    /**
     * 4445 2c
     */
    @IotField(desc = "数据长度",parseType = "StringSchema",hexStart = 2)
    public String dataLen;
    /**
     * 4445 2c
     */
    @IotField(desc = "点位类型",parseType = "StringSchema",hexStart = 3 ,hexValueOptions = "2c")
    public String pointType;
    /**
     * 4445 2c 44454d4f 2c
     */
    @IotField(desc = "数据",parseType = "StringSchema",hexStart = 3)
    public String data;


    public String getMessageMark() {
        return messageMark;
    }

    public void setMessageMark(String messageMark) {
        this.messageMark = messageMark;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getPointType() {
        return pointType;
    }

    public void setPointType(String pointType) {
        this.pointType = pointType;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    @Override
    public String getClientId() {
        return this.deviceId;
    }

    @Override
    public String getMessageId() {
        return this.messageMark+" "+this.pointType;
    }

    @Override
    public String getSerialNo() {
        return String.valueOf(dataLen);
    }


}
